﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Abp.Domain.Repositories;
using Abp.Domain.Services;
using Abp.UI;
using FwProject.Core.AppVersion;
using FwProject.ShoppingMall.Com;
using FwProject.ShoppingMall.EventAdvertising;

namespace FwProject.Manager
{
    public class ShopSupplierManager : IDomainService
    {
        private readonly IRepository<ShopSupplier, Guid> _shopSupplierRepository;

        public ShopSupplierManager(IRepository<ShopSupplier, Guid> shopSupplierRepository)
        {
            _shopSupplierRepository = shopSupplierRepository;
        }
        /// <summary>
        /// 添加一个供应商
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public async Task<Guid> CreateShopSupplier(ShopSupplier model)
        {
            return await _shopSupplierRepository.InsertAndGetIdAsync(model);
        }
        /// <summary>
        /// 修改一个供应商
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>

        public async Task UpdateShopSupplier(ShopSupplier model)
        {

            await _shopSupplierRepository.UpdateAsync(model);
        }

        /// <summary>
        /// 删除一个供应商
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public async Task DeleteShopSupplier(ShopSupplier model)
        {
            await _shopSupplierRepository.DeleteAsync(model);
        }
    }
}
